package com.xiaojiu.nohttp;

import android.content.Context;

import com.xiaojiu.util.JsonUtils;
import com.yolanda.nohttp.RequestMethod;

/**
 * Created by Jacky on 2016/10/31.
 */
public class PostRequest extends BaseRequest<PostRequest> {


    public <T> PostRequest(Context context, String url, T params) {
        this.url = url;
        this.context = context;
        this.params = JsonUtils.string(params);
    }

    public <T> void execute(Class<T> classOfT, RequestArrayListener<T> l) {
        requestMethod(RequestMethod.POST);
        RequestManager.loadArray(this, classOfT, l);
    }

    public void execute(RequestListener l) {
        requestMethod(RequestMethod.POST);
        RequestManager.loadString(this, l);
    }
}
